(function(){var f=document.createElement;f("section");f("nav");f("article");f("aside");f("header");f("footer");f("dialog");f("mark");f("time");f("progress");f("meter");f("ruby");f("rt");f("rp");f("figure");f("video");f("audio");f("source");f("canvas");f("datalist");f("keygen");f("output");f("details");f("datagrid");f("command");f("bb");})()

function Expressions() {
}

Expressions.ie6 = (navigator.appVersion.indexOf("MSIE 6.0") != -1);
Expressions.ie7 = (navigator.appVersion.indexOf("MSIE 7.0") != -1); 

Expressions.k = 1;

Expressions.timer = function() {
	Expressions.k++;
	var timerEle = document.getElementById("expressionTimer");
	if (timerEle) timerEle.innerHTML = Expressions.k;
	return;
};

// :hover
Expressions.hover = function(ele) {
	if (Expressions.ie7) return;
	ele.attachEvent("onmouseover", function(){
		ele.className += " hover";
	});
	ele.attachEvent("onmouseout", function(){
		ele.className = ele.className.replace(/\shover/ig, "");
	});
	Expressions.timer();
	return;
}

// :focus
Expressions.focus = function(ele) {
	ele.attachEvent("onfocus", function() {
		ele.className += " focus";
	});
	ele.attachEvent("onblur", function() {
		ele.className = ele.className.replace(/\sfocus/ig, "");
	});
};

// :before
Expressions.before = function(ele) {
	ele.insertBefore(document.createElement("before"), ele.firstChild);
};

// :after
Expressions.after = function(ele, content) {
	var afterEle = document.createElement("after");
	afterEle.innerHTML = content;
	ele.appendChild(afterEle);
};

// background-origin
Expressions.backgroundOrigin = function(ele) {
	ele.style.backgroundPosition = (ele.offsetWidth - 14) + "px center";
};




